package com.kate.mall.common.json;

import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.type.TypeFactory;
import org.springframework.core.ResolvableType;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.SerializationException;

/**
 * @ClassName NdmallGenericJackson2JsonRedisSerializer
 * @Description TODO
 * @Author 新梦想.陈超
 * @Date 10:56 下午 2023/9/12
 * @Version 1.0
 **/
public class NdmallGenericJackson2JsonRedisSerializer<T> extends GenericJackson2JsonRedisSerializer {
    private final JavaType JAVA_TYPE = TypeFactory
            .defaultInstance()
            .constructType(ResolvableType.forClass(this.getClass()).getSuperType().getGeneric(0).getType());
    @Override
    public <T> T deserialize(byte[] source, Class<T> type) throws SerializationException {
        return super.deserialize(source, type);
    }
}
